bool isValid(char* s) {
    Stack st;
    StackInit(&st);
    while (*s) {
        if (*s == '(' || *s == '[' || *s == '{') {
            StackPush(&st, *s);
        }
        else
        {
            if (StackEmpty(&st))
            {
                return false;
            }
            char a = StackTop(&st);
            if ((a == '(' && *s != ')')
                || (a == '[' && *s != ']')
                || (a == '{' && *s != '}'))
            {
                return false;
            }
            StackPop(&st);
        }
        s++;
    }
    if (!StackEmpty(&st))
    {
        return false;
    }
    return true;
    S